/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package muddb.entities;

import java.io.Serializable;
import javax.persistence.Embeddable;


/**
 *
 * @author keith
 */
@Embeddable
public class MudItemPK implements Serializable {
  private int itemClassId;
  private int itemId;


  public MudItemPK() {
  }


  public MudItemPK( int itemId, int itemClassId ) {
    this.itemId = itemId;
    this.itemClassId = itemClassId;
  }


  public int getItemId() {
    return itemId;
  }


  public void setItemId( int itemId ) {
    this.itemId = itemId;
  }


  public int getItemClassId() {
    return itemClassId;
  }


  public void setItemClassId( int itemClassId ) {
    this.itemClassId = itemClassId;
  }


  @Override
  public int hashCode() {
    int hash = 0;
    hash += (int) itemId;
    hash += (int) itemClassId;
    return hash;
  }


  @Override
  public boolean equals( Object object ) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if ( !( object instanceof MudItemPK ) ) {
      return false;
    }
    MudItemPK other = (MudItemPK) object;
    if ( this.itemId != other.itemId ) {
      return false;
    }
    if ( this.itemClassId != other.itemClassId ) {
      return false;
    }
    return true;
  }


  @Override
  public String toString() {
    return "muddb.entities.MudItemPK[itemId=" + itemId + ", itemClassId=" + itemClassId + "]";
  }

}
